//
//  hotDecalFrame.m
//  庐山通
//
//  Created by zcj on 15-11-5.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//
#define margen 15

#import "hotDecalFrame.h"
#import "HotModel.h"
#import "Grouble.h"

@implementation hotDecalFrame
- (void)setHotModel:(HotModel *)hotModel
{
    _hotModel = hotModel;
    ZCJLog(@"%@",hotModel);
//    @property (nonatomic,assign,readonly)CGRect tidF;// 品论
//
//
//    
//    @property (nonatomic,assign,readonly)CGRect posttimeF;// 时间
//    
//    @property (nonatomic,assign,readonly)CGRect positionF;// 位置
//    名
//
    // 头像
    CGFloat avatarX = margen;
    CGFloat avatarY = margen;
    CGFloat avatarW = ScreenWidth / 10;
    CGFloat avatarH = avatarW;
    _avatarF = CGRectMake(avatarX, avatarY, avatarW, avatarH);
    // 用户名
    CGFloat usernameX = CGRectGetMaxX(_avatarF) + margen;
    CGFloat usernameY = avatarY - 5;
//    CGFloat usernameW =
    CGSize usernameWH = [hotModel.username sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]}];
    _usernameF = CGRectMake(usernameX, usernameY, usernameWH.width, usernameWH.height);
    // 标题
    CGFloat titleX = usernameX;
    CGFloat titleY = CGRectGetMaxY(_usernameF) + margen;
    CGSize titleWH = [hotModel.title sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]}];
    
    _titleF = CGRectMake(titleX, titleY, titleWH.width, titleWH.height);
    // 位置
    CGFloat positionX = CGRectGetMaxX(_titleF) + 2 * margen;
    CGFloat postitionY = titleY;
    CGSize postitionWH = [hotModel.position sizeWithAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12]}];
    
    _positionF = CGRectMake(positionX, postitionY, postitionWH.width, postitionWH.height);
    
    
}
@end
